package com.ruoyi.recipes.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recipes.mapper.SearchLogsMapper;
import com.ruoyi.recipes.domain.SearchLogs;
import com.ruoyi.recipes.service.ISearchLogsService;

/**
 * 菜谱热门搜索Service业务层处理
 * 
 * @author syy
 * @date 2025-08-16
 */
@Service
public class SearchLogsServiceImpl implements ISearchLogsService 
{
    @Autowired
    private SearchLogsMapper searchLogsMapper;

    /**
     * 查询菜谱热门搜索
     * 
     * @param id 菜谱热门搜索主键
     * @return 菜谱热门搜索
     */
    @Override
    public SearchLogs selectSearchLogsById(Long id)
    {
        return searchLogsMapper.selectSearchLogsById(id);
    }

    /**
     * 查询菜谱热门搜索列表
     * 
     * @param searchLogs 菜谱热门搜索
     * @return 菜谱热门搜索
     */
    @Override
    public List<SearchLogs> selectSearchLogsList(SearchLogs searchLogs)
    {
        return searchLogsMapper.selectSearchLogsList(searchLogs);
    }

    /**
     * 新增菜谱热门搜索
     * 
     * @param searchLogs 菜谱热门搜索
     * @return 结果
     */
    @Override
    public int insertSearchLogs(SearchLogs searchLogs)
    {
        searchLogs.setCreateTime(DateUtils.getNowDate());
        return searchLogsMapper.insertSearchLogs(searchLogs);
    }

    /**
     * 修改菜谱热门搜索
     * 
     * @param searchLogs 菜谱热门搜索
     * @return 结果
     */
    @Override
    public int updateSearchLogs(SearchLogs searchLogs)
    {
        return searchLogsMapper.updateSearchLogs(searchLogs);
    }

    /**
     * 批量删除菜谱热门搜索
     * 
     * @param ids 需要删除的菜谱热门搜索主键
     * @return 结果
     */
    @Override
    public int deleteSearchLogsByIds(Long[] ids)
    {
        return searchLogsMapper.deleteSearchLogsByIds(ids);
    }

    /**
     * 删除菜谱热门搜索信息
     * 
     * @param id 菜谱热门搜索主键
     * @return 结果
     */
    @Override
    public int deleteSearchLogsById(Long id)
    {
        return searchLogsMapper.deleteSearchLogsById(id);
    }
}
